#include <YafridngRendererFactoryI.h>

::Yafridng::YafridngRendererPrx YafridngRendererFactoryI::createRenderer(const ::Ice::Int renderEngine,
									 const string& scene, 
									 const ::Ice::Current& c)
{
  if(_proxy)
    {
      try
	{
	  _proxy->flush();
	}
      catch(const Ice::ObjectNotExistException& e)
	{
	}
      _proxy = 0;
    }
      
  Ice::ObjectPtr renderer = new YafridngRendererI(_category, renderEngine, scene, c.adapter->getCommunicator());
  _proxy = YafridngRendererPrx::uncheckedCast(c.adapter->addWithUUID(renderer));
  return _proxy;
}
